﻿@model FlyingClub.Models.ViewsModels.MemberCreateViewModel

@{
    ViewBag.Title = "Editer un membre";
}

<h1>@ViewBag.Title</h1>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <p>@Html.LabelFor(model => model.Firstname, "Prénom")@Html.EditorFor(model => model.Firstname)<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.Firstname)</p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.Lastname, "Nom")@Html.EditorFor(model => model.Lastname)<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.Lastname)</p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.Email, "Email")@Html.EditorFor(model => model.Email)<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.Email)</p>
    <p class="break-line"></p>
    <p><label>Sexe</label><label style="width : auto;">Homme</label>@Html.RadioButtonFor(model => model.Gender, true)<label style="width : auto;">Femme</label>@Html.RadioButtonFor(model => model.Gender, false)<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.Gender)</p>
    <p class="break-line"></p>
    if (Session["Staff"] != null)
    {
        <p><label>Membre du staff</label><label style="width : auto;">Oui</label>@Html.RadioButtonFor(model => model.Staff, true)<label style="width : auto;">Non</label>@Html.RadioButtonFor(model => model.Staff, false)<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.Staff)</p>
        <p class="break-line"></p>
        <p><label>Numéro de license</label>@Html.EditorFor(model => model.InstructorNumber) @Html.ValidationMessageFor(model => model.Staff)</p>
        <p class="break-line"></p>
    }
    else
    {
        @Html.HiddenFor(model => model.Staff)
        @Html.HiddenFor(model => model.InstructorNumber)
    }
    
    
    <p>@Html.LabelFor(model => model.AddressNumber, "Numéro de rue")@Html.EditorFor(model => model.AddressNumber) @Html.ValidationMessageFor(model => model.AddressNumber)</p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.AddressStreet, "Rue")@Html.EditorFor(model => model.AddressStreet) @Html.ValidationMessageFor(model => model.AddressStreet)</p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.AddressCity, "Ville")@Html.EditorFor(model => model.AddressCity) @Html.ValidationMessageFor(model => model.AddressCity)</p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.AddressCode, "Code postal")@Html.EditorFor(model => model.AddressCode) @Html.ValidationMessageFor(model => model.AddressCode)</p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.AddressCountry, "Pays")@Html.EditorFor(model => model.AddressCountry) @Html.ValidationMessageFor(model => model.AddressCountry)</p>
    <p class="break-line"></p>
    
    @Html.HiddenFor(model => model.Password)
    @Html.HiddenFor(model => model.AdhesionDate)
    @Html.HiddenFor(model => model.AdhesionFees)
    @Html.HiddenFor(model => model.Wallet)
    @Html.HiddenFor(model => model.ID)
    
    <p><label></label><input type="submit" /><input type="submit" value="Sauvegarder" /><label style="width : auto; color : rgb(255, 0, 0);">*Champ requis</label></p>
    <p class="break-line"></p>
    <p><label></label><a href="/Members/PasswordEdit/@Model.ID#user">Changer le mot de passe</a></p>
    <p class="break-line"></p>
}
@if (Session["Staff"] != null)
{
    <div class="link-button">
        <a href="/Members/CRUD#admin-members-crud">Retour à la liste des membres</a>
    </div>
    <div></div>
}
